package cn.com.chengq.filesshared.config;

import cn.com.chengq.filesshared.servlet.MyServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyServletConfig {

    private static Logger log = LoggerFactory.getLogger(FacesServletConfig.class);

    @Bean
    public ServletRegistrationBean<MyServlet> myServletRegistration() {
        ServletRegistrationBean<MyServlet> registration = new ServletRegistrationBean<>();
        registration.setServlet(new MyServlet());
        registration.addUrlMappings("/myServlet");
        registration.setLoadOnStartup(1);
        return registration;
    }
}
